package org.kabeja.dxf;

import org.kabeja.dxf.helpers.Point;
import org.kabeja.dxf.helpers.Vector;
import org.kabeja.math.MathUtils;

/**
 * @author shutao
 * @since 2022/4/24 16:36
 */
public class DXFExtrusion {
    private static final double v = 0.015625D;
    protected Vector n = new Vector(0.0D, 0.0D, 1.0D);
    protected Vector x;
    protected Vector y;

    public DXFExtrusion() {
    }

    public double getX() {
        return this.n.getX();
    }

    public void setX(double var1) {
        this.n.setX(var1);
    }

    public double getY() {
        return this.n.getY();
    }

    public void setY(double var1) {
        this.n.setY(var1);
    }

    public double getZ() {
        return this.n.getZ();
    }

    public void setZ(double var1) {
        this.n.setZ(var1);
    }

    public Vector getDirectionX() {
        return Math.abs(this.n.getX()) < 0.015625D && Math.abs(this.n.getY()) < 0.015625D ? MathUtils.crossProduct(DXFConstants.DEFAULT_Y_AXIS_VECTOR, this.n) : MathUtils.crossProduct(DXFConstants.DEFAULT_Z_AXIS_VECTOR, this.n);
    }

    public Vector getDirectionY() {
        return MathUtils.crossProduct(this.n, this.getDirectionX());
    }

    public Point extrudePoint(Point var1, double var2) {
        return MathUtils.getPointOfStraightLine(var1, this.n, var2);
    }

    public Vector getNormal() {
        return this.n;
    }

    public Vector getDirectionZ() {
        return this.n;
    }
}
